<?php

/*
#-----------------------------------------------------------#
#
#  File name: index.php
#  File description: main output file
#  Built on: 04.10.2008
#  Last modified date: 04.10.2008
#  Last modified by: John
#
#-----------------------------------------------------------#
*/

/*
# Object specifications:
# -
*/

require_once ( 'system/config.php' );
require_once ( 'system/parseEngine.php' );
require_once ( 'system/logEngine.php' );

$parseEngine = new dirParser;
$log = new logEngine;
$directories = $parseEngine -> init();
$detailes = $parseEngine->detailes();
$left = $parseEngine->left();
$log -> add ( NULL, 'start' );

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tarantula - Web Directory Submitter</title>
<link href="style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="system/functions.js"></script>
</head>

<body>
  <div id="stats"> <strong>Total directories: <? echo $detailes[0]['nr_dir'] ?></strong> | <strong>Directories submited: <? echo $detailes[0]['nr_submited'] ?></strong> | <strong>Last submit: <? echo $detailes[0]['last_submited'] ?></strong> </div>
<table width="100%" border="0" cellpadding="5">
  <tr valign="top">
    <td width="51%">
    <div id="iframe">
	  <iframe name="dirframe" scrolling="yes">Iframe is not supported</iframe>
	</div>
	</td>
    <td width="49%" valign="top">
  <div id="title">
    <h1><!--<img src="images/web.png" alt="Tarantula" align="absmiddle" width="32" height="32" />--> Welcome to Tarantula</h1>
    <h3>web directory submitter</h3>
  </div>
  <br clear="all" />
  <div id="main">
  You have <? echo $left ?> more directories to submit for today!
    <div id="list">
      <ul>
<?php
	for ( $i = 0; $i < count ( $directories ); $i++ ) {
	$name = $directories[$i]['name'];
	if ( $directories[$i]['url_submit'] != '' ) 
		$submit = $directories[$i]['url_submit'];
	else
		$submit = $directories[$i]['url'];
	$url = $directories[$i]['url'];
	$pagerank = $directories[$i]['pagerank'];
	$alexarank = $directories[$i]['alexarank'];
	if ( $directories[$i]['seo_friendly'] == 'da' )
		$seo_friendly = '<img src="images/bullet_green.png" alt="Submit" align="absmiddle" width="16" height="16" title="SEO Friendly" /> ';
	else  
		$seo_friendly = '<img src="images/bullet_red.png" alt="Submit" align="absmiddle" width="16" height="16" title="Not SEO Friendly" />';
		
	if ( $directories[$i]['link_reciproc'] == 'nu' )
		$link_reciproc = '<img src="images/bullet_green.png" alt="Submit" align="absmiddle" width="16" height="16" title="Backlink" /> ';
	else 
		$link_reciproc = '<img src="images/bullet_red.png" alt="Submit" align="absmiddle" width="16" height="16" title="No backlink" />';
	
		echo '
			<li>
			  '.$seo_friendly.'
			  '.$link_reciproc.'
			  <a href="'.$url.'" target="_blank" title="'.$name.'"><font size="+2">'.$name.'</font></a>
			   <a href="'.$submit.'" target="_blank" title="click here for iframe submission failure"><img src="images/bullet_error.png" alt="Error" align="absmiddle" width="16" height="16" />submission failure</a>
			   <br />
			   Stats: Google Rank: '.$pagerank.' | Alexa Rank: '.$alexarank.' 
			  <hr />
			  <a href="javascript:;" onclick="javascript:tarantula.loadIframe(this)" rel="'.$submit.'"><img src="images/add.png" alt="Submit" align="absmiddle" width="16" height="16" /> submit</a>
			  <a href="system/op.php?mod=submited&url='.$url.'" title="Mark directory as submited"><img src="images/accept.png" alt="Done" align="absmiddle" width="16" height="16" /> done</a> (don\'t click)
			  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			  <a href="system/op.php?mod=junk&url='.$url.'" title="Mark directory as junk"><img src="images/delete.png" alt="Delete" align="absmiddle" width="16" height="16" /> junk</a>
			</li>
			';
	}
?>
      </ul>
    </div>
    
  </div>
    </td>
  </tr>
</table>

<div id="site_detailes">
	<iframe name="siteframe" scrolling="yes">Iframe is not supported</iframe>
    <h3><a href="javascript:;" onclick="javascript:tarantula.pull_detailes();">&darr; Pull site detailes</a></h3>
</div>

</body>
</html>